<?php
namespace app\admin\controller;

use app\common\model\HelpToUpstart as HelpToUpstartModel;

use app\common\component\help_to_upstart\HelpToUpstartService;

class HelpToUpstart extends ControllerBase {
	public function _initialize() {
		$this -> checkLogin();

		$this -> checkAuthorization();
	}

	public function index() {
		$resultHelpToUpstart = HelpToUpstartModel::alias('h_t_u')
			-> join('league_user u', 'h_t_u.user_id = u.user_id')
			-> field(
				'h_t_u.help_to_upstart_id, h_t_u.order_id, h_t_u.price, h_t_u.create_time, h_t_u.over_time, h_t_u.status, ' .
				'u.username, u.realname, u.phone, u.bank_code'
			)
			-> order('h_t_u.status ASC, h_t_u.help_to_upstart_id DESC')
			-> paginate(10);
		$this -> view -> assign('helpToUpstarts', $resultHelpToUpstart);

		return $this -> view -> fetch();
	}
}
?>